import { Component, OnInit, Input, Output, EventEmitter, HostBinding, HostListener } from '@angular/core';
import { Project } from '../../domain/project.domain';
import { cardAnim } from '../../anims/card.anim';

@Component({
  selector: 'app-project-item',
  templateUrl: './project-item.component.html',
  styleUrls: ['./project-item.component.scss'],
  animations: [cardAnim]
})
export class ProjectItemComponent implements OnInit {
  @HostBinding("@card")
  cardState;
  @HostListener('mouseenter')
  onmouseenter() {
    this.cardState = 'enter';
  }
  @HostListener('mouseleave')
  onmouseleave() {
    this.cardState = 'leave'
  }
  @Input()
  item: Project;
  project: Project;
  @Output()
  inviteBtnClicked: EventEmitter<void> = new EventEmitter<void>();
  @Output()
  delBtnClicked: EventEmitter<void> = new EventEmitter<void>();
  constructor() { }

  ngOnInit() {
    this.project = this.item;
  }
  openInviteDialog(e) {
    this.inviteBtnClicked.emit();
  }
  openDelConfirmDialog($event) {
    this.delBtnClicked.emit();
  }

}
